from gameset.phoenicia.base import *


class Sports(CultureEffect):
    name =_ ('Sports')


class Games(CultureEffect):
    name =_ ('Games')


class Athlete(CultureWalker):
    color    =_ (Orange + Red)
    speed    =_ (8)
    distance =_ (75)
    duration =_ (60)
    radius   =_ (7)
    spreads  =_ (Sports(50))


class Competitor(CultureWalker):
    color    =_ (Orange.dark)
    speed    =_ (8)
    distance =_ (100)
    duration =_ (60)
    radius   =_ (7)
    spreads  =_ (Games(50))


class Gymnasium(CultureBuilding):
    name       =_ ('Gymnasium')
    size       =_ (3)
    cost       =_ (120)
    color      =_ (Orange + Red.dark)
    staff      =_ (7)
    profession =_ (Athlete)

    @property
    def ready(self):
        return True
    
    def create_individual(self):
        if self.spawn_point is None:
            return
        
        stadium = self.city.random(Stadium)
        
        if stadium is not None:
            self.spawn(Competitor, target = stadium, freshman = True)
        
        super(Gymnasium, self).create_individual()


class Stadium(CultureBuilding):
    name       =_ ('Stadium')
    size       =_ (9)
    cost       =_ (600)
    color      =_ (Orange + White)
    staff      =_ (45)
    profession =_ (Competitor)
